Method for writing data to a virtual disk using a controller virtual machine and different storage and communication protocols

ABSTRACT

An administrator provisions a virtual disk in a remote storage platform and defines policies for that virtual disk. A virtual machine writes to and reads from the storage platform using any storage protocol. Virtual disk data within a failed storage pool is migrated to different storage pools while still respecting the policies of each virtual disk. Snapshot and revert commands are given for a virtual disk at a particular point in time and overhead is minimal. A virtual disk is cloned utilizing snapshot information and no data need be copied. Any number of Zookeeper clusters are executing in a coordinated fashion within the storage platform, thus increasing overall throughput. A timestamp is generated that guarantees a monotonically increasing counter, even upon a crash of a virtual machine. Any virtual disk has a “hybrid cloud aware” policy in which one replica of the virtual disk is stored in a public cloud.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is related to U.S. patent application Ser. No.14/322,868, now U.S. Pat. No. 9,483,205; U.S. patent application Ser.No. 14/322,867, now U.S. Pat. No. 9,798,489; U.S. patent applicationSer. No. 14/322,855, now U.S. Pat. No. 9,558,085; U.S. patentapplication Ser. No. 14/322,850, now U.S. Pat. No. 9,424,151; U.S.patent application Ser. No. 14/322,813; and U.S. patent application Ser.No. 14/322,871, now U.S. Pat. No. 9,411,534, all filed on the same dateherewith, which applications are hereby incorporated by reference.

FIELD OF THE INVENTION

The present invention relates generally to data storage within a datacenter. More specifically, the present invention relates to storagetechniques and virtual disks within such a data center.

BACKGROUND OF THE INVENTION

In the field of data storage, enterprises have used a variety oftechniques in order to store the data that their software applicationsuse. At one point in time, each individual computer server within anenterprise running a particular software application (such as a databaseor e-mail application) would store data from that application in anynumber of attached local disks. Although this technique was relativelystraightforward, it led to storage manageability problems in that thedata was stored in many different places throughout the enterprise.

These problems led to the introduction of the storage area network inwhich each computer server within an enterprise communicated with acentral storage computer node that included all of the storage disks.The application data that used to be stored locally at each computerserver was now stored centrally on the central storage node via a fiberchannel switch, for example. Although such a storage area network waseasier to manage, changes in computer server architecture created newproblems.

With the advent of virtualization, each computer server could now hostdozens of software applications through the use of a hypervisor on eachcomputer server and the use of virtual machines. Thus, computer serverswhich had been underutilized could now host many different serverapplications, each application needing to store its data within thestorage area network. Weaknesses in the storage area network wererevealed by the sheer number of server applications needing to accessdisks within the central storage node. For example, the storage node wastaxed by the sheer number of requests from all of the applicationservers. Although additional storage nodes could be added (each withmultiple disks), these nodes were expensive, were oblivious to the othernodes, and had to be managed individually. Another weakness was tryingto manage replication of files and disaster recovery. Also, provisioninga new storage disk for a particular virtual machine could take as longas four weeks, much too long for today's pace of innovation. And, inorder to configure a storage system, some prior technologies requiredthe administrator to first purchase a monolithic hardware box and thenone-by-one add the functionalities that he or she desired to protect thedata stored on that hardware. For example, it was often necessary topurchase separate products (or licenses) to perform compression,replication, de-duplication, etc.

In response, new storage services have emerged, such as an Elastic BlockService, which have attempted to make provisioning easier, simplifypolicy management and drive down costs. Unfortunately, this type ofservice only provides a block-level service, among other deficiencies.

SUMMARY OF THE INVENTION

To achieve the foregoing, and in accordance with the purpose of thepresent invention, a number of storage techniques are disclosed thatprovide the advantages discussed below.

The present application provides systems and methods that may beimplemented upon off-the-shelf hardware and in a variety of types ofdata centers. The present invention also provides: incrementalscalability, allowing a data center or enterprise to add only thosecomputer nodes necessary for increased storage capacity; a user-friendlymanagement console to provision virtual disks quickly and easily; and,the ability to define unique policies for specific virtual disks. Unlikecurrent cloud storage services, the present invention provides muchfiner granularity in that an enterprise or data center may provision asingle virtual disk with its own unique properties for an applicationserver, and may define unique sets of policies upon different virtualdisks.

Advantageously, the management console allows an administrator to createa virtual disk (using off-the-shelf hardware within the storageplatform) and provision that virtual disk with functionalities needed toprotect the data (e.g., compression, replication, de-duplication, etc.)that may be specified for that virtual disk.

Larger companies will benefit by deploying embodiments of the presentinvention within their own data centers, while data storage serviceproviders (e.g., RACK SPACE) will benefit by deploying embodiments ofthe present invention within a data center in order to serve theirclients needing storage. Embodiments may also be deployed within thepublic cloud data centers provided by companies like AMAZON.

In a first embodiment, an administrator of a storage system is able toprovision a virtual disk in a remote storage platform for a softwareapplication and can define policies and characteristics that apply tothat virtual disk only. Policy granularity is fine as each virtual diskmay have different policies.

In a second embodiment, a software application running within a virtualmachine on a host computer is able to write to and read from a remotestorage platform using the storage protocol of its choice. A controllervirtual machine on the host computer intercepts these requests and thencommunicates with the remote storage platform using a single protocol.One platform can handle block protocols, Network File System (NFS)protocols, and object writes.

In a third embodiment, all computer nodes within a storage platform worktogether to recover lost data if a disk fails. Virtual disk data withina storage pool that includes the failed disk is migrated to differentstorage pools while still respecting the policies of each virtual disk.

In a fourth embodiment, snapshot and revert commands may be given for avirtual disk at a particular point in time. Overhead is minimal as onlyversion and version tree information need be stored when a snapshotcommand is given.

In a fifth embodiment, a virtual disk may be cloned utilizing snapshotinformation. The clone virtual disk is provisioned as is any othervirtual disk, yet no data need be copied as reads occur from the parentdisk unless data has been written into the clone virtual disk.

In a sixth embodiment, any number of ZOOKEEPER clusters may be executingwithin the storage platform. A software application writes (or reads) toa single cluster and this write is handled by any one of the clusters,thus increasing the overall throughput.

In a seventh embodiment, a timestamp is generated that guarantees amonotonically increasing counter. Even upon a crash or other restart ofa virtual machine (or of the host machine), the timestamp is guaranteedto be monotonically increasing.

In an eighth embodiment, any virtual disk is allowed to have a “hybridcloud aware” policy. This policy dictates that at least one replica ofthe virtual disk must be stored in a public storage cloud, in additionto any other replicas stored in a private data center.

BRIEF DESCRIPTION OF THE DRAWINGS

The invention, together with further advantages thereof, may best beunderstood by reference to the following description taken inconjunction with the accompanying drawings in which:

FIG. 1 illustrates a data storage system having a storage platformaccording to one embodiment of the invention.

FIG. 2 illustrates software modules used within the storage system.

FIG. 3 illustrates in more detail the nodes of the storage platform.

FIG. 4 illustrates in greater detail one of the computer servers incommunication with the storage platform.

FIG. 5 is a flow diagram describing one embodiment by which anadministrator provisions a virtual disk within the platform.

FIG. 6 illustrates a user interface window presented to an administratorin the course of provisioning a virtual disk.

FIG. 7 is a flow diagram describing one embodiment by which a virtualmachine writes data to the storage platform.

FIG. 8 is a symbolic representation of a virtual disk showing how datawithin the virtual disk is stored within the storage platform.

FIG. 9 is a flow diagram describing one embodiment by which a virtualmachine reads data from the storage platform.

FIG. 10 is a flow diagram describing one embodiment by which failurerecovery is performed.

FIG. 11 illustrates how disks within the storage platform are organizedinto storage pools.

FIG. 12 is a flow diagram describing an embodiment in which a read isperformed of the virtual disk in the context of Snapshot and Revertcommands.

FIG. 13 is an illustration of how state variables version and versiontree are updated during the course of commands concerning the virtualdisk.

FIG. 14 illustrates a more complex version tree for a particular virtualdisk.

FIG. 15 is a flow diagram describing an embodiment for cloning a virtualdisk.

FIG. 16 illustrates an architecture of the storage platform used toovercome throughput and latency problems with coordination software.

FIG. 17 illustrates use of a distributed hash table in order toimplement an embodiment of the present invention.

FIG. 18 is a flow diagram describing an embodiment in which data may bewritten to one of many clusters within a storage platform.

FIG. 19 is a flow diagram describing one embodiment by which a timestampis generated.

FIG. 20 illustrates how a timestamp is generated for a particularvirtual disk whenever there is a write request.

FIG. 21 illustrates how requests for a timestamp result in monotonicallyincreasing values.

FIGS. 22A and 22B illustrate metadata storage within the platform.

FIG. 23 shows information that may be stored within a memory cache of acontroller virtual machine (CVM) on one of the computer servers in thecompute farm.

FIGS. 24 and 25 illustrate a computer system suitable for implementingembodiments of the present invention.

DETAILED DESCRIPTION OF THE INVENTION Storage System

FIG. 1 illustrates a data storage system 10 according to one embodimentof the invention having a storage platform 20. Included within thestorage platform 20 are any number of computer nodes 30-40. Eachcomputer node of the storage platform has a unique identifier (e.g.,“A”) that uniquely identifies that computer node within the storageplatform. Each computer node is a computer having any number of harddrives and solid-state drives (e.g., flash drives), and in oneembodiment includes about twenty disks of about 1 TB each. A typicalstorage platform may include on the order of about 81 TB and may includeany number of computer nodes. One advantage is that a platform may startwith as few as three nodes and then grow incrementally to as large as1,000 nodes or more.

Computers nodes 30-40 are shown logically being grouped together,although they may be spread across data centers and may be in differentgeographic locations. A management console 40 used for provisioningvirtual disks within the storage platform communicates with the platformover a link 44. Any number of remotely located computer servers 50-52each typically executes a hypervisor in order to host any number ofvirtual machines. Server computers 50-52 form what is typically referredto as a compute farm. As shown, these virtual machines may beimplementing any of a variety of applications such as a database server,an e-mail server, etc., including applications from companies such asORACLE, MICROSOFT, etc. These applications write to and read data fromthe storage platform using a suitable storage protocol such as iSCSI orNFS, although each application will not be aware that data is beingtransferred over link 54 using a generic protocol implemented by thepresent invention.

Management console 40 is any suitable computer able to communicate overan Internet connection or link 44 with storage platform 20. When anadministrator wishes to manage the storage platform (e.g., provisioninga virtual disk, snapshots, revert, clone, analyze metrics, determinehealth of cluster, etc.) he or she uses the management console to accessthe storage platform and is put in communication with a managementconsole routine executing as part of metadata module 130 (shown in FIG.2) on any one of the computer nodes within the platform. The managementconsole routine is typically a Web server application.

In order to provision a new virtual disk within storage platform 20 fora particular application running on a virtual machine, the virtual diskis first created and then attached to a particular virtual machine. Inorder to create a virtual disk, a user uses the management console tofirst select the size of the virtual disk (e.g., 100 GB), and thenselects the individual policies that will apply to that virtual disk.For example, the user selects a replication factor, a data center awarepolicy and other policies concerning whether or not to compress thedata, the type of disk storage, etc. Once the virtual disk has beencreated, it is then attached to a particular virtual machine within oneof the computer servers 50-52 and the provisioning process is complete.

Advantageously, storage platform 20 is able to simulate prior artcentral storage nodes (such as the VMAX and CLARION products from EMC,VMWARE products, etc.) and the virtual machines and application serverswill be unaware that they are communicating with storage platform 20instead of a prior art central storage node. In addition, theprovisioning process can be completed on the order of minutes or less,rather than in four to eight weeks as was typical with prior arttechniques. The advantage is that one only need to add metadataconcerning a new virtual disk in order to provision the disk and havethe disk ready to perform writes and reads. No allocation of actualphysical storage is needed.

FIG. 2 illustrates software modules used within storage system 10. Shownis a data module 120, a metadata module 130 and a pod module 140. Datamodule handles the storage of data (such as blocks of data, files,objects, etc.) onto individual computer nodes 30-40. Metadata modulehandles the storage of metadata within the platform, that is, data thathelps describe the data. Metadata includes all of the virtual diskinformation described below in FIG. 6, for example. Pod module is acoordinator module and also stores transaction states as will beexplained in greater detail below.

Although shown as three modules, each of the modules runs independentlyon each of the computer nodes within the platform 20. Also, associatedwith each module on each node is a memory cache 122, 132 and 142 thatstores information used by that module; each module on each computernode may also use persistent storage on that node. A file (for example)that is stored on nodes 32, 34 and 36 (FIG. 1), is referred to as beingstored on its “data nodes 32, 34 and 36.” The metadata for that file maybe stored on three different nodes, and those nodes for that file arereferred to as the “metadata nodes 30, 36 and 38.” The data nodes andmetadata nodes for a particular stored file may be the same or may bedifferent. The modules communicate with each other via a modifiedversion of Gossip over Transmission Control Protocol (TCP), and work inconcert to manage the storage platform.

FIG. 3 illustrates in more detail the nodes of platform 20. As shown,each node includes a data module, a metadata module and a pod module.

Controller Virtual Machine

FIG. 4 illustrates in greater detail one of the computer servers 51 incommunication with storage platform 20. As mentioned above, eachcomputer server may host any number of virtual machines, each executinga particular software application. One advantage of the presentinvention is the ability of each virtual machine (or more specifically,the application executing on the virtual machine) to communicate withthe storage platform using any of a variety of protocols. Typically, theapplication performs I/O handling using a block-based protocol such asiSCSI, or using a file-based protocol such as NFS. Each virtual machinemay communicate with the storage platform using either of theseprotocols, and, the actual communication protocol used between serverand platform is transparent to these virtual machines. Of course, othersuitable protocols used by an application may also be used. Oneembodiment of the invention converges the possible protocols used by anapplication onto the single storage platform 20.

As shown, server 51 includes a hypervisor and virtual machines 182 and186 that desire to perform I/O handling using respectively the NFSprotocol 183 and the iSCSI protocol 187. Server 51 also includes aspecialized controller virtual machine (CVM) 180 that is speciallyadapted to handle communications with the virtual machines usingprotocols 183 and 187, yet communicates with the storage platform usinga proprietary protocol 189. Protocol 189 may be any suitable protocolfor passing data between storage platform 20 and a remote computerserver 51 such as TCP. In addition, the CVM may also communicate withpublic cloud storage using the same or different protocol 191.Advantageously, the CVM need not communicate any “liveness” informationbetween itself and the computer nodes of the platform. There is no needfor any CVM to track the status of nodes in the cluster. The CVM needonly talk to a node in the platform, which is then able to routerequests to other nodes and public storage nodes.

The CVM also uses a memory cache 181 on the computer server 51. Incommunication with computer server 51 and with CVM 180 are any number ofsolid-state disks (or other similar memory) 195. As discussed in furtherdetail below with respect to steps 316 and 364 in FIG. 7, these disksare used as a data cache to also store data blocks that are written intostorage platform 20. This cache may be used to rapidly retrieve datablocks instead of retrieving them from the remote storage platform.

CVM 180 handles different protocols by simulating an entity that theprotocol would expect. For example, when communicating with an NFSclient, CVM behaves as an NFS server; when communicating under the iSCSIprotocol, CVM responds to an iSCSI Initiation by behaving as an iSCSITarget. Advantageously, use of the CVM allows an application executingupon a virtual machine to continue using the protocol it expects, yetallows these applications on the various computer servers to write datato and read data from the same storage platform 20.

When virtual machine 182 performs I/O handling the controller virtualmachine is the NFS server and the NFS client (on behalf of virtualmachine 182) executes either in the hypervisor of computer server 51 orin the operating system kernel of virtual machine 182. When virtualmachine 186 performs I/O handling, it is the iSCSI initiator and thecontroller virtual machine is the iSCSI target.

During reads or writes, when either virtual machine 182 or 186communicates with the controller virtual machine (either as an iSCSItarget or as an NFS server), the controller virtual machine will convertthis communication into its own protocol 189 in order to communicatewith the storage platform. In this fashion, any of a variety of datastorage protocols (183, 187, etc.) may be used to write data into andread data from the storage platform. In one embodiment, when anapplication is using the block protocol, the CVM masquerades as theiSCSI target, traps the iSCSI Command Descriptor Blocks (CDBs),translates this information into its own protocol, and then communicatesthis information to the storage platform. In another embodiment when anapplication is using the NFS protocol, the CVM masquerades as an NFSserver, captures NFS packets, and then communicates this information tothe storage platform using its own protocol.

One of the virtual machines in computer server 51 may also communicatedirectly with the storage platform 20 (or with any data center) using aprotocol such as Representational State Transfer (REST) in which the CVMis bypassed completely. But, such a technique would require thedeveloper of the application running on the virtual machine to rewrite asubstantial portion of that application. Using an embodiment of thepresent invention in which the CVM is able to present itself as eitheran NFS server or an iSCSI target (using a software module for eachprotocol), the application may simply talk to the underlying file system(in the case of NFS) or talk to a block device (in the case of iSCSI) asit would do normally. The application is unaware that the CVM istrapping and intercepting its calls under these protocols or that theCVM even exists. The advantage is that an application need not bechanged in order to write to and read from the storage platform.

Provision Virtual Disk

FIG. 5 is a flow diagram describing one embodiment by which anadministrator provisions a virtual disk within platform 20. In thissituation, the administrator is aware that a particular virtual machinedesires a virtual disk within the platform and is aware of thecharacteristics that the virtual disk should have. The administratorfirst uses the management console to access the platform and connectwith the management console Web server on any one of the computer nodeswithin the platform.

FIG. 6 illustrates a user interface window 220 presented to anadministrator in the course of provisioning a virtual disk. In step 204(FIG. 5) the administrator chooses the “Add Disk” option from within themanagement console routine and is presented with a window such as shownin FIG. 6. In step 208 (FIG. 5) the administrator uses window 220 inorder to choose the characteristics of the new virtual disk.

For example, the administrator chooses: a name 224 for the new virtualdisk; a size 226 for the virtual disk; a replication factor 228(indicating how many replicas of the data should be stored within theplatform); a residence 230 (indicating whether the data on the virtualdisk should be stored on hard disk drives, on flash drives or on anyother type of storage drive); compressed 232 (indicating whether thedata on the virtual disk should be compressed or not); de-duplication234 (indicating whether duplicates of the data should be saved to thevirtual disk or not); a replication policy 236 (agnostic, data centeraware, rack aware, or hybrid cloud aware); cache enabled 238 (a qualityof service choice); and disk type 240 (indicating whether the virtualdisk is of a block type—the iSCSI protocol—or whether the virtual diskis of a file type—the NFS protocol). Concerning the Disk Type 240, thisinformation is saved so that the CVM is aware of whether it shouldmasquerade as a block device or as an NFS device in order to communicatewith the application that wishes to write to or read from the virtualdisk.

Replication policy 236 may be “agnostic,” meaning that the virtual disk(or rather, the application on the virtual machine or the owner of thevirtual disk) does not care on which rack or in which data center thereplicas are stored. If the policy is “rack aware” this means that morethan one replica may not be stored on the same rack within a particulardata center. The rack aware policy refers to the fact that computerswithin a data center are typically clustered into racks. Typically,there are twenty computer servers per rack or as many as forty. On thetop of each rack is a network switch used to route information betweenthe various computer servers (also called a “top-of-the-rack switch”).Should this switch fail then all the data located on the computerservers within the rack will become inaccessible or may be lost.Accordingly, an application may desire that its replicas not be storedin the same rack. Choosing the rack aware policy then, requires that nomore than one replica of a particular virtual disk be stored on a singlerack. If the policy is “data center aware” this means that replicas mustbe distributed between data centers in geographically differentlocations. If the policy is “hybrid cloud aware” this means that atleast one replica must be stored within public cloud storage 190, inaddition to the other replicas stored within storage platform 20.

As shown in FIG. 4, replicas of a virtual disk may be stored withinpublic cloud storage 190. As known in the art, public cloud storagerefers to those data centers operated by enterprises that allow thepublic to store data for a fee. Included within these data centers arethose known as AMAZON Web Services and GOOGLE Compute. During a writerequest, the write request will include an identifier for each computernode to which a replica should be written. For example, nodes may beidentified by their Internet Protocol (IP) address. Thus, the computernode within the platform that first fields the write request from theCVM will then route the data to be written to nodes identified by theirInternet Protocol (IP) addresses. Any replica that should be sent to thepublic cloud can then simply be sent to the Domain Name Server (DNS)name of a particular node which request (and data) is then routed to theappropriate public storage cloud. Any suitable computer router withinthe storage platform may handle this operation.

Once the characteristics of the virtual disk have been chosen, then instep 212 (FIG. 5) these characteristics are stored as “virtual diskinformation” 260 onto computer nodes within the storage platform.Preferably, this virtual disk information is replicated and stored on atleast three different computer nodes. The metadata module 130 on thesethree computer nodes handles the storage of this information by placingit into persistent storage as shown in FIGS. 22A and 22B. In oneembodiment, a hash function is used upon the virtual disk name 224 inorder to produce a hash value which is then used to select threecomputer nodes within the platform. For example, the virtual diskinformation for the newly created virtual disk may be stored upon nodes36, 30 and 40. In this fashion, the virtual disk metadata has beenstored upon three metadata nodes within the platform (which might bedifferent from the nodes where the actual data of the virtual disk willbe stored). In one embodiment, step 212 stores this information inmetadata 862 of metadata module storage as shown in FIG. 22A. Asmentioned, this metadata module and its associated storage may bepresent on any of the computer nodes of the platform. And, it ispreferable that virtual disk metadata 862 is replicated upon othermetadata modules on other computer nodes.

Next, in step 216 in FIG. 5 the virtual disk that has been created isattached to a virtual machine of the compute farm. In this step, theadministrator is aware of which virtual machine on which computer of thecompute farm needs the virtual disk. Thus, information regarding thenewly created virtual disk (i.e., name, space available, etc.) is sentfrom the management console routine over link 189 to the appropriatecomputer within the compute farm. The information is provided to thecontroller virtual machine 180 which stores the information in cache181, ready for use when the virtual machine needs to write data. Theadministrator also supplies the name of the virtual disk to theapplication that will use it. At this time, no information need be sentfrom the storage platform or from the CVM to the application.

As part of step 216 the virtual disk information which had been storedonto the metadata nodes in step 212 is also sent to the controllervirtual machine which caches this information for later use. Inaddition, the identities of the metadata nodes which store this metadatafor the virtual disk is also sent to the controller virtual machine.Thus, the controller virtual machine is aware of on which compute nodesof the storage platform the metadata for a particular virtual disk isstored as shown in FIG. 23. At this point, the virtual disk has beenprovisioned and is ready for use. Note that the actual nodes and diskswithin the storage platform have not been allocated yet; such allocationwill occur when the virtual machine writes data.

Write to Virtual Disk

FIG. 7 is a flow diagram describing one embodiment by which a virtualmachine writes data to the storage platform.

FIG. 8 is a symbolic representation of a virtual disk 330 showing howdata within the virtual disk is stored within the storage platform andwill be referred to in the description of FIG. 7. As shown, the virtualdisk has been provisioned as a disk holding up to 50 GB, and the diskhas been logically divided into segments or portions of 16 GB each. Eachof these portions is termed a “container,” and may range in size fromabout 4 GB up to about 32 GB, although a size of 16 GB works well. Asshown, the first portion 332 is referred to as container one, or C1,while the latter portions 334-338 are referred to respectively ascontainers C2, C3 and C4. Note that the final container may have a sizeless than the sizes of the other containers. Containers have aparticular naming convention. In one implementation, the convention isthat the first container of a virtual disk will have a name that is theconcatenation of: virtual disk name, “ ” and “1.” The second containerof that virtual disk will have a nearly identical name except that thefinal symbol will be a “2.” In this fashion, by knowing the containername, one knows with which virtual disk the container is associated. Inaddition, by knowing the virtual disk name, and an offset and size, onewill be able to determine the names of the containers associated with aparticular write request. In this fashion, each container name is uniquewithin the entire storage platform.

Similar to a traditional hard disk, as data is written to the virtualdisk the virtual disk will fill up symbolically from left to right, thatis, first filling container C1 and then container C2, etc. Eachcontainer of data will be stored upon a particular node or nodes withinthe storage platform that are chosen during the write process. If noreplication is chosen, then data within a particular container will bestored on one node, while if replication is two, for example, then datawithin that container will be stored upon two nodes. In the example ofFIG. 8, the replication factor is three, thus, data stored withincontainer 332 will be stored upon the three nodes A, B and F. Any datastored within the second container 334 will be stored upon the threenodes B, D and E. Note that the set of nodes 342 and 344 might be thesame nodes, may be completely different nodes, or may have nodes incommon.

It is possible that when a particular file (for example) is written froma virtual machine to a virtual disk on the storage platform the file maybe written to two different containers, meaning that the file couldpotentially be stored upon six different computer nodes if thereplication factor is three. For example, if virtual disk 330 alreadycontains 12 GB of data and an 8 GB file is to be written, then this filewill span containers one and two because the division between thecontainers is at 16 GB. Thus, the first 4 GB of file will be writteninto the nodes designated for container one, while the second 4 GB ofthe file will be written into the nodes designated for container two.Note that this storage technique using containers is an implementationof the storage platform and is totally transparent to the virtualmachines that are storing data. In this fashion, use of the containersspreads the storage of a virtual disk throughout many different computernodes within the storage platform.

In step 304 in FIG. 7 the virtual machine that desires to write datainto the storage platform sends a write request including the data to bewritten to a particular virtual disk (supplied to the application by theadministrator earlier). As mentioned, a write request may originate withany of the virtual machines on one of computer servers 50-52 and may useany of a variety of storage protocols. The write request typically takesthe form: write (offset, size, virtual disk name). The parameter“virtual disk name” is the name of the virtual disk originally selectedin step 208 in FIG. 5. The parameter “offset” is an offset within thevirtual disk (i.e., a value from 0 up to the size of the virtual disk),and the parameter “size” is the size of the data to be written in bytes.As mentioned above, the CVM will trap or capture this write request sentby the application (in the block protocol or NFS protocol).

Next, in step 308 the controller virtual machine determines whichcontainers to use for this request based upon the offset and sizeparameters. For example, because the CVM is aware of the size of eachcontainer (typically 16 GB), knowing the offset and the size of thewrite request, the CVM is able to determine which container shall beused and whether more than one container is needed. Each container isprovided with a unique identifier within the platform, and containersused to write to other virtual disks will also have an identifier uniquewithin the platform. Assuming that only one container is needed (forexample, C2), the CVM then proceeds to determine on which computer nodesof the storage platform the data should be stored.

In step 312 the CVM queries a metadata node to determine on whichcomputer nodes the container should be stored. Because the particularmetadata nodes on which the metadata for the virtual disk is stored hadbeen previously cached by the CVM, the CVM can easily select one ofthese metadata nodes to query. The CVM sends a query with the containerto be used (e.g., C2) and requests the return of a list of the actualdata nodes on which to write that container. If that container hadpreviously been written to that virtual disk then the metadata nodeknows which data nodes to return because it had previously stored thatinformation. If this is a first write request for a particularcontainer, then the metadata node determines which and how many computernodes to assign to that container based upon how many replicas areneeded. Once the metadata node retrieves or determines the data nodes touse for the write request, it then returns a list to the CVM (e.g., itreturns a list of these nodes 344: B, D and E). The CVM is now ready toperform the write request.

In step 316 the CVM then sends the write request (in this case, simplythe data itself to be written) to one of the data nodes returned in theprevious step (e.g., data node E). The write request also includes anindication of the other two data nodes (B, D) to which the data shouldbe written. The data node that receives the request then writes the datato its disk drives and then forwards the data to the other two nodes.Once each of these nodes writes the data to its disk drives, each ofthese nodes returns an acknowledgment back to the first data node thathad originally received the request from the CVM.

The CVM also sends with the write request the relevant policies for theparticular virtual disk. For example, the CVM indicates how manyreplicas are needed, the type of storage disk required, whether the datashould be compressed, what the replication policy is, etc. The data nodethat receives the request will then handle implementations of all ofthese policies. The CVM does not need to concern itself with how thesepolicies are implemented; it simply sends the write request with therelevant information.

Also in step 316, because the CVM has a cache 181 that contains thecurrent version and version tree for each virtual disk that is attachedto it (i.e., for each virtual disk used by the virtual machines on thesame computer as the CVM), the CVM is also able to send the currentversion of the virtual disk with the write request so that as blocks ofthe virtual disk are written onto their data nodes the current versionmay be stored along with each block. Versions and version trees ofvirtual disks are discussed in more detail below with respect to FIGS.12-14. A timestamp is also sent with the write request.

In addition to writing the data over an Internet connection to datanodes within a remote storage platform 20, the CVM also writes the samedata blocks into solid-state storage 195 in FIG. 4 (a block cache) sothat the data blocks may be read from this cache much more quickly ifneeded. The data blocks are identified within this cache preferablyusing the block identifiers.

In step 320 this first data node (e.g., E) acknowledges that the writehas occurred to the CVM and returns the names of the data nodes (e.g.,B, D and E) where the data was written.

In step 324 the CVM then calculates the block identifiers (i.e., blocks1, 2, 3) within the virtual disk where the data has been stored and thensaves this information into the metadata nodes associated with thevirtual disk. As is known in the art, disks are typically divided upinto blocks (usually blocks of 4K) and data is written to, and readfrom, disks using blocks. Because the CVM is aware of the offset for thewrite request, the CVM then knows the block identifier for the firstblock to be written for the current write request. And, because the sizeof the write request is also known, the CVM is then able to easilycalculate onto which data nodes blocks of data were written, and thecorresponding block identifiers for those blocks of data. In the currentexample, the CVM calculates the block identifiers for those blocks ofdata in the current write request which were written to nodes B, D andE. Even if a write request spans two different containers, by simplecalculation using the container size, offset, and size of the writerequest, the CVM will be able to determine which block identifiers werewritten to the first container and which block identifiers were writtento the second container.

The CVM then stores these block identifiers where the current write wassuccessful into the three metadata nodes holding the metadata for thecurrent virtual disk as shown in FIG. 22B. Thus, these three metadatanodes are always aware which block identifiers have been written forthis particular virtual disk. Of course, other virtual disks that havebeen created within the storage platform may use different sets of threemetadata nodes (or perhaps fewer or more metadata nodes) in order tostore their metadata.

In step 324 the locations of the containers (nodes and storage pools)are also written into the metadata modules associated with that virtualdisk.

In step 324 the CVM also sends the current version of the virtual diskwith the block identifiers so that the current version may be storedalong with the block identifiers in the metadata nodes as shown in FIG.22B at columns 882, 884 etc. (e.g., “Version” of “CH1$Version”).

In addition, the CVM also generates a timestamp and includes thistimestamp along with the block identifiers so that each block includes atimestamp in metadata. As known in the art, a timestamp may be generatedin a variety of manners. In one preferred embodiment, a timestamp isgenerated as discussed below with respect to FIGS. 19 and 20.

Preferably, write operations do not overwrite older versions of data. Inthis fashion, earlier versions of data in a virtual disk are alwaysavailable to be read. Thus, snapshot and revert operations can beperformed very quickly because data does not need to be copied intospecial storage locations or retrieved from special storage locations.All versions of data are always available within the storage platform.As shown in FIG. 22B, blocks of data are stored as “chunks,” each chunkincluding in its name the version number which identifies the version ofthe data stored.

Read from Virtual Disk

FIG. 9 is a flow diagram describing one embodiment by which a virtualmachine reads data from the storage platform.

In step 364 the virtual machine that desires to read data from thestorage platform sends a read request from a particular application tothe desired virtual disk. As explained above, the controller virtualmachine will then trap or capture the request (depending upon whether itis a block request or an NFS request) and then places a request into itsown protocol before sending a request to the storage platform.

As mentioned, a read request may originate with any of the virtualmachines on computer 51 (for example) and may use any of a variety ofstorage protocols. The read request typically takes the form: read(offset, size, virtual disk name). The parameter “virtual disk name” isthe name of a virtual disk on the storage platform. The parameter“offset” is an offset within the virtual disk (i.e., a value from 0 upto the size of the virtual disk), and the parameter “size” is the sizeof the data to be read in bytes.

In one embodiment, the CVM first checks its block cache 195 to determinewhether any of the blocks to be read are already present within thiscache. If so, these blocks are retrieved from block cache 195 instead ofhaving to establish a remote connection with storage platform 20 andretrieve those blocks remotely which would take a greater deal of time.

Next, in step 368 the controller virtual machine determines whichcontainer or containers to read from for this request based upon theoffset and size parameters as described above. The CVM also determinesthe block identifiers that it needs to read using the offset and thesize from the request.

In step 372 the CVM queries a metadata node to determine on whichcomputer nodes the data blocks identified by the block identifiers arewritten. Because the particular metadata nodes on which the metadata forthe virtual disk is stored had been previously cached by the CVM, theCVM can easily select one of these metadata nodes to query. The CVMsends a query with a container identifier (e.g., C2) and requests thereturn of a list of the actual computer nodes on which the data had beenwritten. The metadata node knows which data nodes to return because ithad previously stored that information in step 324 (FIG. 7); see, forexample, FIG. 23. Once the metadata node retrieves the data nodes wherethe data blocks were stored, it then returns a list to the CVM (e.g., itreturns a list of these nodes 344: B, D and E). The CVM is now ready toperform the read request.

In step 376 the CVM then sends the read request to each of the datanodes returned in the previous step. The read request includes a list ofblock identifiers to be read and a timestamp. In one embodiment, atimestamp with a read request is useful for the following reasons. Asmentioned above, performing a write request for a particular containerto any number of data nodes may result in success or failure. If theresult indicates failure, then the CVM will not update the relevantmetadata nodes to indicate that the write was actually performed.Nonetheless, it is possible that the data might have been written to atleast one data node within the storage platform. Upon a subsequent readoperation of that same container, is important not to read theinformation that might have been written to a node during the failedwrite operation. It is important to read information for that containerfrom a previous successful write operation. Thus, the read request willinclude a timestamp from the previous successful write operation inorder to avoid reading the wrong data. Because every successful writeoperation records the timestamp of that successful write operation intothe relevant metadata nodes, the CVM can obtain this timestamp for thelast successful write operation in step 372.

The CVM sends along with the read request all version numbers for thedata that it is requesting along with the version tree. How to obtainthese version numbers is discussed in more detail below with respect toFIG. 12. The version number is useful because the particular readrequest will need to read from the current version using the versiontree, backtracking to the root of the tree as explained below. Thistechnique provides the requesting application with the correct versionfrom the virtual disk.

In step 380 each data node returns the data identified by the blockidentifiers to the CVM. In step 384 the CVM then returns this data tothe requesting virtual machine using the appropriate protocol 183 or187, again masquerading either as a block device or as an NFS devicedepending upon the protocol used by the particular application.

Alternatively, the read request is sent to only one of the data nodes(e.g., B) and also includes an indication of the other two data nodes(D, E) from which the data should be read. The first data node thenpasses the read request to each of the other data nodes. Each of thesedata nodes that receives the request then reads the data from its diskdrives. Once each of these nodes reads the data from its disk drives,each of these nodes returns the data back to the first data node thathad originally received the request from the CVM. This first data nodethen returns the data to the CVM.

Storage Pool Migration

In the field of data storage, disk failure and the reconstruction of thelost data is a problem to be addressed. In the past, a redundant arrayof independent disks (RAID) has been used to address this problem.Currently, however, disks are becoming extremely dense but are notnecessarily becoming relatively faster. For example, a single disk maynow store up to 4 TB of data; if this disk were to fail, it can takehours to reconstruct all of the lost data from other disks. During thereconstruction the server application that relies upon those disks willbe degraded, and, should another disk fail, the storage infrastructurecan be continuously attempting to reconstruct data and the applicationwill be further degraded.

In order to address the above problem, a storage pool migrationtechnique is disclosed that allows many, if not all, of the computernodes within a storage platform to participate in the datareconstruction, thus leading to faster recovery. In addition, when datafrom a failed disk is reconstructed at a different location the datawill be reconstructed using all of the relevant policies of the virtualdisk from which that data is a part. Lost data from a failed disk isreconstructed quickly and applications that rely upon the storageplatform are not degraded.

FIG. 10 is a flow diagram describing one embodiment by which thisfailure recovery is performed.

FIG. 11 illustrates how disks within the storage platform are organizedinto storage pools and will be discussed in the context of the flowdiagram of FIG. 10. Shown is one computer node 30 of the storageplatform having a unique identifier “A.” Associated with, and under thecontrol of, each computer node are any number of hard drives orsolid-state disks. Shown are nine disks that are organized into groupsof three, each group forming a storage pool 454, 456 or 458. Of course,more or fewer disks may be associated with each node, there may be moreor fewer storage pools, and the number of disks within each storage poolmay vary. Each storage pool within the platform also has a uniqueidentifier such as “storage pool 1,” etc. As earlier discussed, when anapplication writes data to its virtual disk that data will be assignedto a particular container and that container will be written to aparticular node or nodes (as shown in FIG. 8).

As shown in FIG. 11, containers written to a particular disk willnecessarily be assigned to a particular storage pool. In this example,containers C1, C3 and C8 have previously been written into a disk ordisks within storage pool 454. Various implementations may be used towrite a container into a storage pool. One technique simply writes aparticular container onto a single disk within the storage pool. In apreferred technique, a given container is written to a storage pool byspreading the blocks of a container across all of the disks within thatstorage pool. Of course, other techniques used to write blocks of dataonto a disk or disks may also be used.

FIGS. 22A and 22B illustrate persistent storage of a metadata module 130executing upon a particular computer node within the platform. Asmentioned before, each computer node includes an executing metadatamodule each storing metadata concerning nodes, virtual disks, etc. Forexample, persistent storage for node A (for example) includes metadata862 concerning the virtual disk named “Avinash.” Of course, othermetadata may also be stored within this storage. The contents of thispersistent storage will be discussed in more detail below.

Referring again to FIG. 10, in step 404 the metadata for each computernode within the storage platform are determined at any suitable time. Inother words, a computer node such as node “A” will have its metadatastored on at least one computer node within the platform, and preferablythree. This metadata will be stored using the metadata module executingupon each node and stored within persistent storage associated with eachmetadata module. The metadata nodes for a particular computer node aredetermined by using a hash function on the unique identifier for aparticular node to produce a hash value. This hash value is then used toidentify three computer nodes within the platform that will be themetadata nodes for that particular node.

In this example, FIG. 22A shows that metadata module persistent storagestores metadata on computer node “A.” Step 404 also includes storing thestorage pool identifiers and the disk identifiers for each node into themetadata module storage. As shown in FIG. 22A, metadata 860 includes theunique identifiers of the storage pools (e.g., “SP1”) associated withnode “A” as well as the unique identifiers for each disk (e.g., “D1”),and in which storage pool each disk belongs. Metadata 861 also includescontainer information showing which containers are stored within eachstorage pool; in this example, container Vi$2 is stored in storage poolSP3.

Step 404 is performed for each computer node within the platform and maybe performed at any suitable point in time, preferably when the platformis first initialized, or when containers are written.

In step 408 at some point in time the failure of a disk is detectedwithin the platform. This failure may be detected in many ways. When adisk fails, it is assumed that the data present on that disk is lost andthat the data should then be reconstructed as there may not be enoughreplicas of the data according to the replication factor of the virtualdisk of which the data was a part.

In step 412 the storage pool that includes the failed disk is disabled.For example, assuming that disk D2 has failed, then the module willdisable storage pool 454 because disk D2 is part of that storage pool.In this embodiment, the entire storage pool is disabled rather thansimply disabling the failed disk. Disabling a storage pool means that nomore data will be written to any of the disks within that pool and thatno more reads will be performed from that pool. Preferably, the datamodules 120 are responsible for performing storage pool migration.

In step 416 the module determines which containers are present on thedisabled storage pool and therefore, which containers must bereconstructed. Because it is known which particular disk has failed andwhich storage pool has been disabled, the module may then referencemetadata 861 (for example) to determine which containers have been lost.For example, knowing that disk D2 has failed on computer node “A” themodule finds the metadata module storage for node “A” and determinesthat containers C1, C3 and C8 have been lost. As shown in FIG. 11,containers 460 have unique identifiers within the storage platform andthese containers may be part of any of the virtual disks stored withinplatform. In other words, containers C1, C3 and C8 may be part ofdifferent virtual disks, or, they may all be part of the same virtualdisk.

Step 420 begins a loop that iterates over each of the lost containersusing the unique identifier for each lost container. In step 424 acandidate computer node within the storage platform is selected to holda new replica of the lost container that respects the policies of thevirtual disk that includes the lost container. For example, given theunique identifier of a lost container, the module then referencesmetadata 862 to determine the relevant policies of that virtual diskthat must be complied with. Because the container identifier includesthe virtual disk name, the module then knows the virtual disk name andcan find its virtual disk information on the appropriate metadata node.In this example, the candidate node must comply with the Replicationpolicy and the Residence policy of virtual disk Avinash.

For example, if the Replication policy states that each of the threereplicas of the virtual disk must be stored in a geographically separatedata center (“data center aware”), this means that the candidate nodemust not be located in a data center where the remaining two replicasare located. If the Replication policy states that replicas must bestored in different racks (“rack aware”), this means that the candidatenode must not be located in a rack where the remaining two replicas arelocated. If the Replication policy states that at least one replica mustbe located in public cloud storage (“hybrid cloud aware”), this meansthat the candidate node must be located in public cloud storage if oneof the other replicas is not already located there. Complying with theResidence policy means that the candidate node must have disks of a typespecified in the Residence policy, i.e., hard disks or solid-state diskson which the entire container can be stored. Of course, there may beother policies that must also be complied with. The information thatdescribes the Replication and Residence characteristics of each node(among others) may be found by querying each node, by looking at themetadata for a particular node, or using other suitable techniques.

Once another computer node has been selected (after reviewing any numberof candidate nodes) that respects the policies of the virtual disk towhich the lost container belongs, then in step 428 the lost container iscopied from one of its remaining replicas onto the selected node. Forexample, if it is known that computer nodes “B” and “C” hold replicas ofthe lost container, then one of these replicas may be used to copy a newreplica onto the selected node. If node A respects the policies then itmay be used as the selected node even though it is the node where thedisk just failed, i.e., another storage pool on node A may be selectedeven though a storage pool on node A just failed. In an alternativeembodiment, no storage pool on node A may be used as it may be unclearwhy one of the storage pools failed.

Finally, because a new replica of the container now exists on a new nodeand on a new disk, the metadata module storage corresponding to thatcomputer node is now updated with the new information. For example, ifcontainer C1 has now been written to node “D” then the metadata modulestorage associated with node “D” is then updated to reflect thatcontainer C1 is now present within a particular storage pool of thatnode.

Virtual Disk Snapshot

As known in the art, taking a “snapshot” of a file, database or disk ata particular point in time means saving the existing state of that dataso that it may be referenced at a later point in time, even afterchanges have been made to the disk after the snapshot was taken.Primarily used for data protection, snapshots may be used in thedevelopment of a particular software application. If the application(and its data) are executing successfully at a particular point in time,a snapshot of the software application and of its data at that time maybe taken before any new features are added, before a new version isintroduced, before the data is changed, or before other changes occurthat might corrupt the data. If corruption of the data (or of theapplication) occurs, then one simply reverts to the snapshot of thatdata before the corruption occurred. Typically, though, taking asnapshot or reverting is dependent upon the amount of data that is beingprotected. If a snapshot or revert command needs to copy all of the datafrom one location to another, this can be very time-consuming (and errorprone) if the size of the data is large. Even if copying only involvesrecent changes (or “deltas”) to the data, this can be time consuming.

This embodiment of the present invention provides techniques forcreating a snapshot of a virtual disk (recording a version of that diskat a particular point in time) and for reverting to that earlier versionof the virtual disk (the snapshot) that is not dependent upon the sizeof the virtual disk or the amount of data it contains. No data of thevirtual disk needs to be copied during either the snapshot command orthe revert command. The result is data protection that is simple, fastand inexpensive. The data of the virtual disk may be data of anapplication, source or object code of the application, etc.

In order to avoid overwriting a block of data having a version 1 with adifferent block of data having a version 2, an implementation may beused such as shown in FIG. 22B, in which blocks (or chunks) of datahaving different versions are stored in different locations, i.e.,particular versions of particular blocks are not overwritten within theplatform.

FIG. 12 is a flow diagram describing an embodiment in which a read isperformed of the virtual disk in the context of Snapshot and Revertcommands.

FIG. 13 is an illustration of how state variables version 554 andversion tree 556 are updated during the course of commands concerningvirtual disk 552. This figure will be discussed in greater detail belowin the context of the steps of FIG. 12.

In step 504, while a particular virtual disk is being provisioned, itsversion number and version tree are initialized. This initialization maybe performed during step 212 (FIG. 5) and involves updating metadata 862(for this particular virtual disk, for example) so that the version isset equal to “1” and the version tree data structure includes only theroot, also with the value of “1.” Further, in step 216 (again see FIG.5) the version and version tree are also stored into cache 181 (FIG. 4)of the controller virtual machine along with the rest of the virtualdisk information.

A symbolic representation of commands given to this virtual disk and ofhow the values for its version and version tree change as these commandsare given are shown in FIG. 13. Shown symbolically is a particularvirtual disk 552 and listed below it vertically are a sequence ofSnapshot and Revert commands issued to this virtual disk. Version 554shows how the version changes as these commands are given, and Versiontree 556 shows how the version tree data structure changes as well. Asshown at state 560, once the virtual disk has been provisioned it has aversion equal to “1” and its version tree is simply the root 570. Anynumber of write requests and read requests (and other commands) may beissued to the virtual disk yet the virtual disk remains in state 560 inwhich its version is “1” and its version tree is root 570.

At a particular point in time, an application developer, administrator,or other entity that controls the virtual disk may desire to issue aSnapshot command for that virtual disk. Such a situation may occurbefore new features are introduced into the application, before anoperating system update, before a new version of the application isintroduced, before data is changed, etc. In any case, the administratordesires to save the exact state of the data currently present on thevirtual disk so that it may be retrieved and used at a later point intime. Accordingly, in step 508 a Snapshot command is issued for thevirtual disk and may be issued using the management console or a commandline interface. The Snapshot command takes one parameter which is thename of the virtual disk. This command causes the version for thatvirtual disk to increase in step 512 and also causes a branch to beadded to the version tree in step 516. FIG. 13 illustrates these changescaused by issuance of the Snapshot command. As shown in virtual disk(column) 552 the virtual disk enters into a new state 562 in which theversion is changed to “2” and the version tree has a new node “2” addedwith a link back to the root “1” as shown at updated version tree 572.

Issuance of the Snapshot command returns the name of the Snapshot whichincludes the version at the time the command was issued (i.e., beforethe version is increased) and the name of the virtual disk. For example,the Snapshot command returns a Snapshot name which is “Snap$1 -Avinash.”Other descriptive information may also be added by the administratorwhen issuing the Snapshot command and would become part of the Snapshotname.

These changes are then stored in the metadata for the virtual disk inquestion, in this example, stored into metadata 862 (FIG. 22A) of ametadata module on the computer nodes that are responsible for themetadata of that particular virtual disk. In addition, the version andversion tree are also sent to the controller virtual machine to whichthe virtual disk is attached so that the cache of the CVM will always beup to date.

The upshot of increasing the version by one is that any write requestsperformed for this virtual disk after the Snapshot command has beenissued will be written with the new version, namely “2.” The updatedversion tree 572 indicates symbolically that version “2” is based uponversion “1.” Of course, this version tree may be implemented in thememory of the metadata module storage and in the cache of the CVM usingany appropriate data structure. In step 520 (FIG. 12), commands may beissued to the virtual disk such as write requests and read requests, andthese commands will take place in the context of state 562, namely thatthe current version of the virtual disk is version “2.”

At some future point in time the administrator may wish to revert to anearlier state (or version) of the virtual disk. In this simple example,only a single snapshot exists that was created when the virtual disk wasin version “1,” and the name of that snapshot is “Snap $1 -Avinash.”Responsibility for remembering when particular snapshots were created,and the context of the snapshots within the development of a particularsoftware application, rests with the administrator or others. Any of avariety of schemes may be used for recording snapshot names, particularversion numbers, relevant events, etc. Because a snapshot name includesits version number and the name of the virtual disk, it can be a simplematter to decide which snapshot to use when a particular earlier versionis desired.

Accordingly, in step 524 an administrator issues a Revert command thatincludes a particular snapshot name, for example, “Revert Snap $1-Avinash.” In this example, the virtual disk now enters state 564, theversion is changed to “3” in step 528, and the version in the metadatanodes tree has a new branch added in step 532 so that it appears asshown in version tree 574. From this point forward, any write requestswill be in the context of version “3.” As shown in the new version tree574, when a Revert command is given a new branch is added having the newversion number “3,” the branch has a reference back to the version thatwas in place for the snapshot desired. In this example, because thevirtual disk reverts to a snapshot created when the version was “1,”branch “3” of the version tree points back to branch “1,” which in thiscase is the root. When a Revert command is issued the version is alsoincremented by one because even though the virtual disk reverts to itslast known state in version “1,” other changes may occur, hence, a newversion is indicated. Thus, after the Revert command has been issued theversion of the virtual disk is version “3” and other write requests takeplace in the context of this version. A read request will also includethe current version so that the current version of the data is alwaysread. A write request will also include the current version number.

In step 536, a read request is performed in the context of versionnumbers from the version tree. When an application on a virtual machinerequests to read from a virtual disk the flow will occur as described inFIG. 9 except that the CVM will provide a version number along with theread request in step 376. In step 376 before the CVM sends the readrequest to the data nodes it will first access the version tree datastructure for the particular virtual disk stored within its cache (oroptionally may retrieve this data structure in step 372 from themetadata node). The CVM will start at the current version (in this case,version “3”) and then walk through the existing links all the way backto the root, collecting version numbers as it goes. In this case, theCVM collects versions “3” and “1”. When the read request is then sent instep 376 these collected version numbers are also sent. When each datanode then attempts to read particular blocks of data from one of itsdisks, it will only read blocks having versions “3” or “1”. Data blockshaving other versions will be ignored because these blocks do notcorrespond to the current version that the application wishes to readafter issuing the Revert command.

FIG. 14 illustrates a more complex version tree for a particular virtualdisk. When the disk is first provisioned its version is “1,” the versiontree is simply the root as shown at 570, and any I/O handling occurs inthe context of this version. At some point, the administrator issues aSnapshot command while in version 1; the version of the virtual disk isincremented to “2” and the version tree now appears as shown at 580. Atsome future time the administrator issues another Snapshot command whilein version 2; the version is incremented to “3” and the version tree nowappears as shown at 582. At some future time the administrator issues aRevert command back to version “2” while in version “3;” the version isincremented to “4” and the version tree now appears as shown at 584.Branch “4” references back to branch “2” because the Revert commandwanted to revert back to version “2.”

At some point, the administrator issues a Snapshot command while inversion “4;” the version of the virtual disk is incremented to “5” andthe version tree appears as shown at 586. At some future time theadministrator issues another Snapshot command while in version 5; theversion is incremented to “6” and the version tree then appears as shownat 588. At this point in time, the version tree includes all branches orversions 1-6; branches or versions 7-9 are yet to be added.

Next, while in version “6,” the administrator issues a Revert commandback to version “5”; the version is incremented to “7” and the versiontree then appears as shown at 590. Another Snapshot command is issuedwhile in version “7;” the version is incremented to “8” and the versiontree now appears as shown at 592. While in version “8” the administratordesires to revert back to version 4. After the Revert command is given,the version is incremented to “9” and the version tree now appears asshown at 594 with a link from branch or version 9 returning to branch orversion 4. Once in version “9,” any read request will include theversion numbers 9, 4, 2 and 1, as these are the version numbers found inthe version tree as the CVM walks back through the tree from the currentversion to the root.

Thus, Snapshot and Revert commands may be executed that do not dependupon the amount of data in the virtual disk; these commands may beexecuted within milliseconds as the only two operations needed are theupdating of the version and the updating of the version tree. Becauseolder versions of data blocks are always saved and not overwritten,these older versions are always available and data need not be copied orsaved when a snapshot command is given. Likewise, when a revert commandis given, data need not be copied from a special storage location backinto the virtual disk because all versions of all data stored are alwayspresent within the platform.

Clone a Virtual Disk

FIG. 15 is a flow diagram describing an embodiment for cloning a virtualdisk. Advantageously, this embodiment provides a technique by which theclone of a virtual disk may be created with all of the same parametersand policies of the parent virtual disk, or, entirely new and differentparameters and policies may be provided for the same data. For example,a clone of a virtual disk may specify different media on which the dataof the clone should be stored (e.g., solid-state drives instead of harddisk drives), may specify different physical locations for the data(e.g., a data center aware policy instead of an agnostic policy), etc.

These different policies are implemented when new data is written to theclone disk. For example, if the parent virtual disk is all stored onhard disk drives, when the clone virtual disk is created all of itsinformation by default will all be stored on hard disk drives as well,even if the clone virtual disk specifies solid-state drives. If onlyread operations are performed, the reads will always be from hard diskdrives. Data will be written to solid-state drives as specified by theclone virtual disk when writes occur. The same holds true for the datacenter and rack aware policies as well. Thus, the different policies areimplemented when data is written to the clone disk. As mentionedearlier, a write request includes the policies for a virtual disk (fromthe CVM cache) to ensure that data is written to a virtual disk usingthe correct policies.

One example of when it would be useful to clone a virtual disk involvestesting an application. Consider a production system having a databaseexisting within the storage platform on solid-state drives. If adeveloper wants to test new features of the application it will bedesirable to have a test database that looks and feels very similar tothe production database. This embodiment of the invention is able totake a snapshot of the production database on the virtual disk, make aclone of that virtual disk, and store changes to the database onto harddrives instead of onto the solid-state drives. Thus, the test databaseand any changes to it will reside on media that is less expensive thansolid-state drives.

In step 604 an administrator desires to create a copy of a virtual diskwithin the storage platform and issues a command to clone the virtualdisk. The clone command may be given from the management console andtypically takes the form “Clone—virtual disk name—snapshot name—metadataproperties.” The “virtual disk name” is the name of the virtual disk tobe copied and is known as the parent virtual disk. The “snapshot name”is the name of a particular snapshot that has been created for theparent virtual disk and is explained in more detail with respect to step508 in FIG. 12. In particular, note that a snapshot of a virtual disk iscreated when the virtual disk is in the context of the current version;this current version becomes part of the snapshot name that the modulereturns to the administrator. For example, referring back to FIG. 14, ifthe administrator creates a snapshot of this virtual disk while inversion “5” then the name of the snapshot will be returned and willinclude the numeral “5” within its name. Accordingly, any clone virtualdisk created from a parent virtual disk using snapshot “5” will includeall of the information included in that parent virtual disk up to andincluding version “5.”

The parameter “metadata properties” allows the administrator to specifyany of the parameters and policies shown in FIG. 6, for example, andincludes any other parameters or policies that can be specified whenadding a new virtual disk. For example, the command in step 604 mayspecify that the clone virtual disk must use compression, that its datashould be stored upon solid-state drives, that its replication factorshould be five, that its replication policy should be hybrid cloud datacenter aware, etc. These parameters and policies may be different fromthat of the parent virtual disk or they may be the same.

In step 608 the clone virtual disk is provisioned as is any new virtualdisk according to steps 212 and 216 (FIG. 5) including providing theclone disk with its own unique name. For example, three metadata nodeswill be chosen for this clone virtual disk and its clone virtual diskinformation will be stored in storage of these metadata nodes such as isshown at metadata 862 (FIG. 22A). In addition, the clone virtual diskwill be attached to the same virtual machine as the parent virtual disk.Alternatively, the clone virtual disk may also be attached to adifferent virtual machine on a different computer on direction by anadministrator.

The clone virtual disk also receives its own version (“1” to begin with)and its own version tree. Notably, creating the clone virtual disk fromthe parent virtual disk does not involve copying any data from theparent virtual disk. When writes occur information will be written tothe clone virtual disk, but reading will occur from the parent virtualdisk unless a write request has previously written to the location inthe clone disk where the read will occur.

In step 612 the name of the parent virtual disk and the snapshot versionused are recorded for future use. Both are retrieved from the clonecommand. Because the cloned virtual disk was created from a particularversion of the parent virtual disk at a particular point in time, itwill be necessary to refer to the version tree of the parent virtualdisk when performing certain read operations. Preferably, the parentvirtual disk and version are recorded in the relevant metadata node forthe clone virtual disk.

When first created the actual space allocated for the clone virtual diskis empty; however, reads and writes may be performed on the clonevirtual disk in the same way that these operations are performed on theparent virtual disk with the exception of a variation in how a read isperformed.

In step 616 the virtual machine to which the clone virtual disk has beenattached writes to the clone virtual disk. This step may be performed aspreviously described with respect to FIG. 7. Note that writing to aclone virtual disk does not write data into the parent virtual disk. Theclone virtual disk is a separate virtual disk within the storageplatform. All data written to the clone virtual disk is placed intocontainers associated with the clone virtual disk.

In step 620 the virtual machine to which the clone virtual disk has beenattached reads from the clone virtual disk. This step generally followsthe flow shown in FIG. 9; if data is found in step 624 (containerlocations are found in step 372 in FIG. 9), then in step 628 (FIG. 15),the data is read from the clone virtual disk.

On the other hand, if an attempt is made to read from the clone virtualdisk at a particular offset and no data is found in step 624, then thedata must be read from the parent virtual disk. On a write operation therelevant metadata node for a particular virtual disk will record thatthe write has been performed for a particular portion or container ofthat virtual disk. Thus, if querying the metadata node in step 372 doesnot find that a write has been performed for this portion or container,this means that no data has been written to the clone virtual disk as ofthis time, and the following steps are performed. First, the parentvirtual disk name and its snapshot version are retrieved from thelocation where they were stored in step 612, that is, in the metadatanode for the clone virtual disk.

Because the clone virtual disk was created from a particular snapshot ofthe parent virtual disk, any read must take place from the version wherethe snapshot was created. Accordingly, the name of the parent virtualdisk is used to find the correct metadata node that holds the metadatafor that parent virtual disk, and from there the version tree for thatparent virtual disk is retrieved. Next, using the version from the clonecommand, the version tree of the parent virtual disk is walked from thatversion back to the root to obtain the appropriate version numbers for aread operation. For example, if a clone virtual disk was created basedupon Snapshot “5” of a parent virtual disk having a version tree such asis shown in FIG. 14, then the correct version numbers to supply to theread request are 5, 4, 2, 1. These version numbers are then used toperform a read request from the parent virtual disk as per steps 368-384(FIG. 9). The offset and size parameters were originally supplied in theread request at step 620 (FIG. 15).

In this fashion, correct data is read from the parent virtual disk. Oncedata is written into the clone disk at a particular offset, any futurereads from that offset will read from the clone disk and not from theparent disk.

Multiple Clusters

FIG. 1 also illustrates how the computer nodes of the storage platformmay be organized into various clusters. Shown are two clusters, 62 and64, that each include three computer nodes. Coordination between nodessuch as those of storage platform 20 that provides distributed storagecan be difficult. A number of software products may be used to providethis coordination. One in particular is “Apache ZOOKEEPER,” an opensource project that provides centralized infrastructure and servicesacross a single cluster of computer nodes for storage of data. Forexample, ZOOKEEPER provides a configuration service, a synchronizationservice, a naming service, and other services that can used by anapplication to ensure that tasks across the cluster are serialized orsynchronized. Although such software is highly reliable, it is expensivein terms of throughput and latency. In other words, storing a dataobject into a single cluster using the software can become a bottleneckfor performance of the entire storage platform. And, while ZOOKEEPER maybe used to store data into a single cluster of computer nodes, if thereis more than one cluster of nodes these clusters will be independent andwill not be able to coordinate storage between themselves. An improvedsystem that provides for greater throughput is desirable. In general,the ZOOKEEPER software is an example of replicated PAXOS instancesoftware, and is an implementation of the prior art “Chubby Service.”

FIG. 16 illustrates an architecture 700 of the storage platform 20 usedto overcome throughput and latency problems with coordination softwaresuch as ZOOKEEPER. Instead of a single ZOOKEEPER cluster providingcoordination for a number of machines, multiple ZOOKEEPER clusters areused to provide greater throughput for the entire platform. Shown areclusters 702 and 704. Of course, there may be many more such clusterswithin a particular platform. And, although three machines are shown ineach of the clusters, typically a cluster includes anywhere from threeto five machines, or more. As is known in the art, each computer node ofcluster 702 includes a ZOOKEEPER instance which is in communication withthe other instances within cluster 702 (not shown for clarity is abidirectional link between node 30 and node 34). In this embodiment, thepod module of each computer node (explained above) incorporates theZOOKEEPER instance as well as other software. Another ZOOKEEPER cluster704 is also shown. Unlike the prior art, though, the various ZOOKEEPERclusters can communicate with one another as described below, and thusappear as a single ZOOKEEPER cluster. Each cluster is aware of the otherclusters.

Thus, the speed with which data objects can be written to storageplatform 20 is increased by a factor of two in this example. If therewere four ZOOKEEPER clusters (for example), the speed would then beincreased by a factor of four over use of a single traditional ZOOKEEPERcluster, etc. Advantageously, a software application (such as one of theapplications executing within the compute farm) can simply perform awrite to what it thinks is a single ZOOKEEPER cluster, when in actualitythere may be any number of ZOOKEEPER clusters all operating in concertto write the data as quickly as possible. Other entities that may writeto a ZOOKEEPER cluster include one of the modules of the platform, acontroller virtual machine, one of the metadata nodes, one of the datanodes, etc.

FIG. 17 illustrates use of a distributed hash table in order toimplement an embodiment of the present invention. As known in the art,often a key/value pair is needed to be stored; hash functions are usedto map the particular key into a particular hash result, which is thenused to store the value into a location dictated by the hash result.Rather than use a single hash function (or single hash table) to mapkeys to different computer nodes for storage, this embodiment maps keysto different clusters of computer nodes, thus enabling a write requestor a read request to be able to write to, or read from, any number ofZOOKEEPER clusters within a storage platform.

Shown is use of a hash function 720. In this simple example, the rangeof possible results of the hash function is from 0 up to 1, and therange is divided up into four portions, each portion corresponding to aparticular ZOOKEEPER cluster within the platform. For example, the rangeof results from 0 up to point 722 corresponds to cluster 62 (computernodes A, B, C), and the range of results from point 722 two point 724corresponds to cluster 64 (computer nodes D, E, F). The other twoportions correspond to other potential clusters within the platform. Ofcourse, the range of possible results of the hash function may be quitedifferent, any particular hash function may be used (or similarfunctions), and there may be any number of clusters within the platform.In this example, a hash of a particular key results in a result 730 thatcorresponds to cluster 64. Thus, if a value associated with theparticular key is desired to be stored within the platform, this exampleshows that the information will be stored within cluster 64.

In this embodiment, each pod module on each computer node executes aprocess to implement such a hash function, thus providing a distributedhash table between all of the computer nodes. In the context of storageplatform 20, these coordinated clusters are used to write transactionalinformation into the metadata nodes of the cluster. Because of thereliability of information stored within a ZOOKEEPER cluster, if thereis a failure of any one of the nodes, the information may be safelyretrieved from one of the other nodes within the cluster.

FIG. 18 is a flow diagram describing an embodiment in which data may bewritten to one of many clusters within a storage platform. In thisparticular embodiment, each cluster may be a ZOOKEEPER cluster as shownin FIG. 16. In step 754 a write request is sent to a single cluster ofthe storage platform (for example, cluster 704) using a protocolsuitable for storing data within a single ZOOKEEPER cluster. The writerequest may originate from any source, although in this example itoriginates with one of the virtual machines executing upon one of thecomputer servers 50-52.

The write request includes a “key” identifying information to be storedand a “value” which is the actual data to be stored. Advantageously, anentity sending a write request need only communicate with a singleZOOKEEPER cluster of the platform and requests will be distributedthroughout the clusters of the platform as dictated by the distributedhash table. Also, the entity may send the request to any cluster of theplatform.

In step 758 one of the computer nodes of the cluster (node E, forexample) fields the write request and determines which is the correctcluster of the platform to which the request should be sent. Morespecifically, the pod software module executing on the computer nodetakes the key from the write request, calculates a hash result using thehash function, and then determines to which cluster the request shouldbe sent using the distributed hash table (for example, as shown in FIG.17). Each pod module executing on each computer node uses the same hashfunction and distributed hash table in order to route write requestsappropriately throughout the storage platform. For example, the podmodule executing on node E may determine that the hash result fallsbetween 0 and point 722 and thus the write request should be sent tocluster 702.

Next, in step 762 node E routes the write request to cluster 702, forexample, via communication link 710. It is possible that the writerequest should be routed to the same cluster in which the hash result iscalculated. In other words, the request is not routed to a differentcluster but stays within the same cluster.

In step 766 the cluster 702 will then write the data value to each ofits nodes using the ZOOKEEPER protocol. Finally, this cluster returnstatus information to the entity that requested the write.

Thus, any number of different entities (such as the virtual machines ofFIG. 1 or any of nodes 30-40) may send write requests to any clusterwithin platform 20; the steps described above will ensure that thesewrite requests are distributed throughout the platform to differentZOOKEEPER clusters thus increasing the throughput by factor equal to thenumber of ZOOKEEPER clusters.

In a similar fashion the platform may handle read requests. Instead of awrite request being sent in step 754 the entity sends a read request toa single cluster in the platform including only the key for the datavalue desired. The correct cluster is determined in step 758, the readrequest is routed to the correct cluster in step 762, in step 766 thecorrect cluster then uses the key to obtain the appropriate data valueand returns the data value to the entity that had sent the read request.

Timestamp Generation

FIG. 19 is a flow diagram describing one embodiment by which a timestampis generated. Within a storage system, it is often desirable to place atimestamp in association with stored blocks of data in order to indicatewhen the data was stored, to be able to retrieve the latest data, to beable to retrieve different versions, and to coordinate I/O handlingbetween different computers or virtual machines. Unfortunately, relyingupon a clock within a computer (or from an outside source) is often notpractical as the clocks between computers may be keeping slightlydifferent time. In the context of the present invention, if thecontroller virtual machines on different computers are keeping slightlydifferent time then it can be problematic to exchange data between theseCVMs or to move a virtual disk from one CVM to another.

One embodiment of the present invention provides a technique forproviding a monotonically increasing counter for each virtual disk thatguarantees that each request to generate a timestamp for the virtualdisk returns an increasing value. Advantageously, no persistent storageis needed by the CVM in order to keep track of the increasing values inorder to generate a timestamp when needed by a virtual disk. Even whenthe controller virtual machine or its host computer crashes and needs tobe restarted, there is still a guarantee that the next request for atimestamp for a particular virtual disk will be a monotonicallyincreasing value that is greater than the previous value requested forthat virtual disk. And, no clock values are needed to generate atimestamp.

During I/O handling for a particular virtual disk each write request orread request (steps 316 (FIG. 7) and 376 (FIG. 9)) will include atimestamp. A single timestamp is generated for each write request andthis timestamp is associated with all blocks that are written to thevirtual disk for that write. As shown in the metadata module storage ofFIG. 22B, along with the container identifiers stored in associationwith a particular node, a block identifier and a timestamp (TS) isstored for each block written into a particular container. If a writerequest for a particular virtual disk necessitates writing a number ofblocks, each block written will have the same timestamp. During a readrequest, use of the timestamp ensures that the latest valid data is readfrom the virtual disk.

In step 804 a generation number for a particular virtual disk isinitialized when that virtual disk is provisioned as discussed abovewith respect to FIG. 5. During step 212 (FIG. 5) the generation numberis set equal to “1” and this generation number is stored into themetadata node for that virtual disk, for example, stored into metadata862 for the virtual disk “Avinash.” In addition, during the attach step216 (FIG. 5), this same generation number is also stored into memory ofthe controller virtual machine to which the virtual disk has beenattached. Note that although the generation number is placed intopersistent storage on the metadata node, it may be stored in volatilememory of the CVM.

FIG. 20 illustrates how a timestamp 840 is generated for a particularvirtual disk whenever there is a write request. Shown is storage of thevirtual disk generation number 850 in the metadata module correspondingto the particular virtual disk, and storage of the virtual diskgeneration number 846 into memory of the CVM to which that virtual diskis attached.

In step 808 in FIG. 19 a counter is initialized for the particularvirtual disk. Again, initialization of this counter may occur in step216 (FIG. 5) when the virtual disk is attached to a particular virtualmachine. Preferably, the counter is implemented by the CVM and may beimplemented in hardware or software; any of a variety of counters asknown in the art may be used. The counter is initialized with a value of“0” and each time a request is made of the counter its value isincremented by “1” and that new value is returned. As shown in FIG. 20,each CVM includes a virtual disk counter 848 for each virtual diskattached to that CVM.

In step 812 the CVM requests a new timestamp for a particular virtualdisk whenever it needs to write data to the virtual disk.

In step 816 a new timestamp is generated. As shown in FIG. 20, atimestamp is a 64-bit value with MSB 842 of 32 bits and LSB 844 of 32bits. Of course, other sizes of a timestamp and of the MSB and LSB mayalso be used. In order to generate the timestamp the value of thegeneration number 846 from the CVM memory is placed into the MSB of thetimestamp and a request is made of the virtual disk counter 848 for anew value which is placed into the LSB of the timestamp. Once generated,this timestamp is then returned to the CVM for use in the write request.

In step 820, at some point in time it is possible that a particularcontroller virtual machine or its host computer must restart orbootstrap (reboot) such that any volatile memory contents are lost. Thisrestart may occur because the CVM crashes, because the hypervisorcrashes, because the host computer crashes, because of a manual restart,or for other reasons. As mentioned above, because the generation number846 and the counter 848 are stored in memory of the CVM host computer,these values will be lost upon a restart. In order to continue toprovide a monotonically increasing value to the CVM when needed for awrite request the following steps are taken.

In step 824 the CVM queries the storage platform in order to determinewhich virtual disks are attached to that CVM. As shown in FIG. 22A, eachcomputer node of the storage platform includes a metadata module whichstores in persistent storage metadata information for all virtual disksassociated with that computer node. As shown in metadata 862 (forexample), this metadata includes the generation number for each virtualdisk. By querying each computer node of the storage platform in turn,the CVM can determine not only which were the virtual disks attached tothat particular CVM, but also the current generation number for each ofthose virtual disks. Also included within the virtual disk informationis the IP address (or other unique identifier) of the CVM to which thevirtual disk is attached. In this fashion, any CVM can determine towhich CVM a particular virtual disk is attached.

In step 828, once those virtual disks are identified that are attachedto the CVM that was restarted, the CVM directs that each generationnumber within the metadata be increased by “1.” Thus, for example, avirtual disk which had a generation number of “1” before the CVM wasrestarted will now have a new generation number of “2.” In step 832 thisnew generation number for each virtual disk is copied from metadata on ametadata node to CVM memory as shown in FIG. 20, i.e., from location 850to location 846. In step 836 each virtual disk counter 848 of the CVM isalso initialized as described above in step 808. In this fashion, thenext request for a timestamp by the CVM will result in a monotonicallyincreasing value.

FIG. 21 illustrates how requests for a timestamp results inmonotonically increasing values even in the context of a restart of thecomputer, controller virtual machine or software application. The firsttwo requests for a timestamp result in values 855 and 856 beingreturned. Value 856 shows that the timestamp is made up of two values,namely MSB 853 (which corresponds to the generation number) and LSB 854which corresponds to the virtual disk counter. As I/O handling occurs,and the values increase monotonically (by virtue of the virtual diskcounter increasing), eventually a value such as value 857 will bereturned. At 858 a restart occurs resulting in the loss of memory and ofthe generation number and counter for a particular virtual disk on aparticular host computer 52. Using the above generation technique, thenext request for a timestamp results in value 859 which is amonotonically increasing value after value 857.

Storage of Metadata

FIGS. 22A and 22B illustrate metadata storage within platform 20. Themetadata used within storage system 10 encompasses many types andincludes: virtual disk information; container location information(including on which storage pools the containers are located and onwhich nodes); storage pool information (including which nodes have whichpools and which disks); and mutation information after write requests(where were blocks written, success and failure, etc.). As mentionedearlier, while the data associated with a particular write request mayend up on three different data nodes, the metadata informationassociated with virtual disks, write requests, etc. will be stored usingthe metadata modules 130 on the computer nodes, and these nodes may bedifferent from the nodes used for data storage.

FIG. 22A illustrates three types of information stored by a metadatamodule. Each of these types of information may use any suitable datastructure and each type of information is independent of the others andmay use a different data structure. Shown, for example, is persistentstorage on node A that has been stored by its metadata module. Shown at860 is the storage pool information or metadata for that node, showingwhich storage pools are present on that node and which disks areassociated with each storage pool. Shown at 861 is container locationinformation or metadata. Using the naming convention for containersdiscussed above, this shows that container “Vi$2” (associated withvirtual disk “Vi”) is located on node A and that it is part of storagepool SP3. The second listed container Vj$7 is shown as being part of thestorage pool SP2. Of course, many other containers that are stored onnode A may also be listed in this data structure. Shown at 862 are allof the policies and other metadata information for the virtual disknamed “Avinash.” Of course, any number of virtual disks may also havetheir information or metadata 864 stored on this particular node.

FIG. 22B illustrates another type of information stored by a metadatamodule. Shown, for example, is persistent storage on node D that hasbeen stored by its metadata module. Shown symbolically (not to scale) at870 is a virtual disk showing how its stored information is representedwithin metadata storage. In this example, assume that the virtual diskhas a size of 1 TB, that each chunk portion has a size of 256 kB, assumethat each block has a size of 4 kB, and that 66 blocks have been writteninto this virtual disk. Chunks 871 and 872 illustrate that metadata isstored on a per chunk basis.

For a particular virtual disk “Vi” 880 (this metadata storage regionhaving any number of rows of information, each row representing avirtual disk), write information is stored in columns 882, 884, etc.,each column corresponding to a particular chunk of the virtual disk. Forexample, column 882 represents the first chunk and also includes theversion number. Column 884 represents the second chunk. In thisembodiment, there will be a new column if the version is incremented andone writes again into the first chunk. In this fashion, older versionsof data are never overwritten or lost, they are all saved within thestorage platform for later reference if necessary.

Within each chunk column 882, are individual block columns 890, 892,etc., representing the individual blocks of that chunk that have beenwritten to the virtual disk. For example, column 890 includes the blocknumber “1,” the computer nodes to which that block was written, whethernot the write was a success, and a timestamp. Column 892 includessimilar information for the second block. Within column 882 there willbe 64 individual block columns due to the size of the blocks and thesize of the chunks. Column 884 will also include the same number ofblock columns, for example, block column 896 identifies the block number“66,” and the information earlier described. In this fashion, themetadata for particular virtual disk 880 is stored upon one of thecomputer nodes using its metadata module, and includes an identificationof where each of its blocks were stored, a version, a timestamp, etc.

FIG. 23 shows information that may be stored within memory cache 181(see FIG. 4, e.g.) of a controller virtual machine (CVM) 180 on one ofthe computer servers. Preferably, all information concerning aparticular virtual disk attached to a CVM will be organized into avirtual disk object and then stored into the memory cache. A hash tableis used to store these virtual disk objects and the key to find eachobject is the name of the virtual disk. Stored within this cache is thegeneration number 846, virtual disk information 260 and metadata nodes898 indicating on which nodes the metadata for this virtual disk isstored.

Computer System Embodiment

FIGS. 24 and 25 illustrate a computer system 900 suitable forimplementing embodiments of the present invention. FIG. 24 shows onepossible physical form of the computer system. Of course, the computersystem may have many physical forms including an integrated circuit, aprinted circuit board, a small handheld device (such as a mobiletelephone or Personal Digital Assistant (PDA)), a personal computer or asuper computer. Computer system 900 includes a monitor 902, a display904, a housing 906, a disk drive 908, a keyboard 910 and a mouse 912.Disk 914 is a computer-readable medium used to transfer data to and fromcomputer system 900.

FIG. 25 is an example of a block diagram for computer system 900.Attached to system bus 920 are a wide variety of subsystems.Processor(s) 922 (also referred to as central processing units, or CPUs)are coupled to storage devices including memory 924. Memory 924 includesrandom access memory (RAM) and read-only memory (ROM). As is well knownin the art, ROM acts to transfer data and instructions uni-directionallyto the CPU and RAM is used typically to transfer data and instructionsin a bi-directional manner. Both of these types of memories may includeany suitable of the computer-readable media described below. A fixeddisk 926 is also coupled bi-directionally to processor(s) 922; itprovides additional data storage capacity and may also include any ofthe computer-readable media described below. Fixed disk 926 may be usedto store programs, data and the like and is typically a secondary massstorage medium (such as a hard disk, a solid-state drive, a hybriddrive, flash memory, etc.) that can be slower than primary storage butpersists data. It will be appreciated that the information retainedwithin fixed disk 926, may, in appropriate cases, be incorporated instandard fashion as virtual memory in memory 924. Removable disk 914 maytake the form of any of the computer-readable media described below.

Processor(s) 922 is/are also coupled to a variety of input/outputdevices such as display 904, keyboard 910, mouse 912 and speakers 930.In general, an input/output device may be any of: video displays, trackballs, mice, keyboards, microphones, touch-sensitive displays,transducer card readers, magnetic or paper tape readers, tablets,styluses, voice or handwriting recognizers, biometrics readers, or othercomputers. Processor(s) 922 optionally may be coupled to anothercomputer or telecommunications network using network interface 940. Withsuch a network interface, it is contemplated that the CPU might receiveinformation from the network, or might output information to the networkin the course of performing the above-described method steps.Furthermore, method embodiments of the present invention may executesolely upon processor(s) 922 or may execute over a network such as theInternet in conjunction with a remote CPU that shares a portion of theprocessing.

In addition, embodiments of the present invention further relate tocomputer storage products with a computer-readable medium that havecomputer code thereon for performing various computer-implementedoperations. The media and computer code may be those specially designedand constructed for the purposes of the present invention, or they maybe of the kind well known and available to those having skill in thecomputer software arts. Examples of computer-readable media include, butare not limited to: magnetic media such as hard disks, floppy disks, andmagnetic tape; optical media such as compact disc read only memories(CD-ROMs) and holographic devices; magneto-optical media such asfloptical disks; and hardware devices that are specially configured tostore and execute program code, such as application-specific integratedcircuits (ASICs), programmable logic devices (PLDs) and ROM (read onlymemory) and RAM (random access memory) devices. Examples of computercode include machine code, such as produced by a compiler, and filescontaining higher-level code that are executed by a computer using aninterpreter.

Although the foregoing invention has been described in some detail forpurposes of clarity of understanding, it will be apparent that certainchanges and modifications may be practiced within the scope of theappended claims. Therefore, the described embodiments should be taken asillustrative and not restrictive, and the invention should not belimited to the details given herein but should be defined by thefollowing claims and their full scope of equivalents.

I claim:
 1. A method of writing to a virtual disk within a storageplatform, said method comprising: issuing a write request from asoftware application executing within a virtual machine of a computerserver to write data to a virtual disk of a remote storage platform,said write request using a first storage protocol; intercepting saidwrite request by a controller virtual machine of said computer server;sending said write request along with said data from said controllervirtual machine to a computer node of said storage platform using acommunication protocol different from said first storage protocol;issuing a second write request from a second software applicationexecuting within a second virtual machine of said computer server towrite second data onto a second virtual disk of said remote storageplatform, said second write request using a second storage protocoldifferent from said first storage protocol; intercepting said secondwrite request by said controller virtual machine of said computerserver; sending said second write request along with said second datafrom said controller virtual machine to a computer node of said storageplatform using said communication protocol which is different from saidsecond storage protocol; writing said data to said virtual disk usingsaid computer node and at least one other computer node of said storageplatform; acknowledging said writing of said data from said at least oneother computer node of said storage platform to said computer node;acknowledging said writing of said data to said controller virtualmachine by said computer node of said storage platform; andacknowledging said writing of said data to said software applicationfrom said controller virtual machine using said first storage protocol.2. A method as recited in claim 1 further comprising: acknowledging saidwriting of said data to said controller virtual machine by said storageplatform.
 3. A method as recited in claim 1 wherein said first storageprotocol is the Network File System (NFS) protocol or the Internet SmallComputer System Interface (iSCSI) protocol.
 4. A method as recited inclaim 1 wherein use of said communication protocol is transparent tosaid software application.
 5. A method as recited in claim 1 whereinsaid second storage protocol is the Network File System (NFS) protocolor the Internet Small Computer System Interface (iSCSI) protocol.
 6. Amethod of writing to a virtual disk within a storage platform, saidmethod comprising: receiving a first write request from a first softwareapplication executing within a first virtual machine of a computerserver to write first data to a first virtual disk of a remote storageplatform, said first write request using a first storage protocol andbeing received by a controller virtual machine; sending said first writerequest along with said first data from said controller virtual machineto a computer node of said storage platform using a communicationprotocol different from said first storage protocol, and writing saidfirst data to said first virtual disk of said remote storage platformusing said computer node and at least one other computer node; receivinga second write request from a second software application executingwithin a second virtual machine of said computer server to write seconddata to a second virtual disk of said remote storage platform, saidsecond write request using a second storage protocol different from saidfirst storage protocol; sending said second write request along withsaid second data from said controller virtual machine to a computer nodeof said storage platform using said communication protocol which isdifferent from said second storage protocol, and writing said seconddata to said second virtual disk of said remote storage platform;acknowledging said writing of said first data from said at least oneother computer node of said storage platform to said computer node;acknowledging said writing of said first data to said controller virtualmachine by said computer node of said storage platform; acknowledgingwriting of said first data to said first virtual disk to said firstsoftware application from said controller virtual machine using saidfirst storage protocol; and acknowledging writing of said second data tosaid second virtual disk to said second software application from saidcontroller virtual machine using said second storage protocol.
 7. Amethod as recited in claim 6 wherein said first storage protocol is theNetwork File System (NFS) protocol or the Internet Small Computer SystemInterface (iSCSI) protocol.
 8. A method as recited in claim 7 whereinsaid second storage protocol is the Network File System (NFS) protocolor the Internet Small Computer System Interface (iSCSI) protocol.
 9. Amethod as recited in claim 6 wherein use of said communication protocolis transparent to said first and second software applications.